﻿@{
    ViewBag.Title = "Tree";
}

<form>
    <div id="menu"></div>
</form>
<script type="text/javascript">
    var AppID = '@Request.QueryString["appid"]';
    var roleid = '@Request.QueryString["roleid"]';
    var roadTree = null;
    $(function ()
    {
        loadTree(roleid);
    });
    function loadTree(id)
    {
        $("#menu").html('');
        if (id.length > 0)
        {
            roadTree = new RoadUI.Tree({ id: "menu", path: "Tree1?roleid=" + id, refreshpath: "TreeRefresh", onclick: openUrl });
        }
    }
    function reLoad(id)
    {
        if (roadTree != null)
        {
            roadTree.refresh(id);
        }
    }
    function openUrl(json)
    {
        parent.frames[1].location = "Body?id=" + json.id + "&appid=" + AppID + "&roleid=" + $("#role").val();
    }
</script>